#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>
double newton_1(double x1, double acy)
{
	double x, fx, f;
	x = fx = f = 0;
	while (fabs(x1 - x) > acy)
	{
		x = x1;
		fx = x * x * x - x * x - 1;
		f = 3 * x * x - 2 * x;
		x1 = x - fx / f;
	}
	return x1;
}
double newton_2(double x1, double acy)
{
	double x, fx, f;
	x = fx = f = 0;
	while (fabs(x1 - x) >= acy)
	{
		x = x1;
		fx = x * x * x * x - 3 * x + 1;
		f = 4 * x * x * x - 3;
		x1 = x - fx / f;
	}
	return x1;
}
double newton_3(double x1, double acy)
{
	double x, fx, f;
	x = fx = f = 0;
	while (fabs(x1 - x) >= acy)
	{
		x = x1;
		fx = x - exp(-x);
		f = 1 + exp(-x);
		x1 = x - fx / f;
	}
	return x1;
}
int main()
{
	int op;
	double a, b, ans;
	while (scanf("%d", &op) != EOF)
	{
		a = b = ans = 0;
		scanf("%lf %lf", &a, &b);
		if (op == 1)
		{
			ans = newton_1(a, b);
			printf("%d %.2le %.5lf\n", op, b, ans);
		}
		else if (op == 2)
		{
			ans = newton_2(a, b);
			printf("%d %.2le %.5lf\n", op, b, ans);
		}
		else
		{
			ans = newton_3(a, b);
			printf("%d %.2le %.5lf\n", op, b, ans);
		}
	}
	return 0;
}